<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>LeaveList</title>

</head>
<body>
 
	<h1 class="text-center">Leave List</h1>
	<div class="row">
               
					<table class="table table-striped table-hover">
						<tr>
							<th>ID</th>
							<th>Ref_No</th>
							<th>Reason</th>			
							<th>Duration</th>
							<th>Status</th>
							<th>Detail</th>

						</tr>
						
						<c:forEach items="${leaveRecords}" var="leavelist">
							
							<tr>
								<td>${leavelist.users.id}</td>
								<td>${leavelist.refNo}</td>
								<td>${leavelist.additionalReason}</td>					
								<td>${leavelist.duration}</td>
								<td>${leavelist.leaveStatus}</td>
								<td>
								<spring:url value="LeaveDetail/{refNo}.html"
										var="ownerUrl">
										<spring:param name="refNo" value="${leavelist.refNo}" />
									</spring:url> 
								<c:if test="${leavelist.leaveStatus == 'applied' }">
								<a href="${ownerUrl}"><c:out value="Detail" /></a>
								</c:if>
								</td>
							</tr>
						</c:forEach>
					</table>
					</div>
	
</body>
</html>